package org.he.basic.listener;

import org.he.auth.service.IPermissionScanService;
import org.he.basic.enums.RequestTypeEnum;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.context.ContextLoaderListener;
import org.springframework.web.context.WebApplicationContext;

import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import javax.servlet.annotation.WebListener;
import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
import java.util.Objects;

/**
 * @author He
 * @date 2023/12/2  13:46
 * ContextLoaderListener 实现了(implements) ServletContextListener接口
 */
@WebListener
public class PermissionListener extends ContextLoaderListener {
    @Autowired
    private IPermissionScanService permissionScanService;
    @Override
    public void contextInitialized(ServletContextEvent event) {
        System.out.println("监听器启动................");
        // 扫描controller
        permissionScanService.scan();
        System.out.println("监听器停止................");
    }

}
